function gadget:GetInfo()  
 return {     name      = "Space Rock",     
	desc      = "Spawns rocks from space.",    
	author    = "oksnoop2",    
	date      = "4/24/2010",     
	license   = "GNU GPL, v2 or later",   
	layer     = 0,     
	enabled   = true,  --  loaded by default?  
} end 

if not gadgetHandler:IsSyncedCode() then   
return false -- no unsynced code 
end


local meteorDefName  = "wreckage" 
local meteorInterval = 1 
--local fallGravity = 1 
local meteorSpawnHeight = 5000 
--local burnEffect1 = "smallburn"
--local burnEffect2 = "medburn
local count = 0
local X = 0
local Z = 0
Z111 = 0
local meteors = {} 
-- meteor set  
function gadget:GameFrame(frame)    
	if frame % (120 * meteorInterval) == 3 then      -- pick a random location as the meteor spawn point     
		local meteorSpawnX = math.random(Game.mapSizeX - Game.mapSizeX/2)  + Game.mapSizeX / 4
		local meteorSpawnZ = math.random(Game.mapSizeZ - Game.mapSizeZ/2) + Game.mapSizeZ / 4
		--Spring.Echo(" X: " .. meteorSpawnX .. " Z: " .. meteorSpawnZ)
	
		local meteorSpawnY = Spring.GetGroundHeight(meteorSpawnX, meteorSpawnZ)  
		local meteorID = Spring.CreateUnit(meteorDefName, meteorSpawnX, meteorSpawnY, meteorSpawnZ, "n", Spring.GetGaiaTeamID()) -- will ignore Y and spawn at ground level     
		--meteors[meteorID] = true -- put it in the meteor set          Spring.MoveCtrl.Enable(meteorID) -- tell spring we'll take care of moving the meteor     
		--Spring.MoveCtrl.SetPosition(meteorID, meteorSpawnX, meteorSpawnY, meteorSpawnZ) -- this time the height will be set correctly     
		--Spring.MoveCtrl.SetGravity(meteorID, fallGravity) -- make gravity affect the meteor   
	--end      
	--[[for meteorID in pairs(meteors) do  -- loop through every meteor in the meteor set     
		local x, y, z = Spring.GetUnitPosition(meteorID)    
		local h = Spring.GetGroundHeight(x, z)    
		if y < h then -- if the meteor below ground level       
			Spring.DestroyUnit(meteorID) -- make it explode      
			meteors[meteorID] = nil -- remove it from the meteor set    
		else -- above ground, show the meteor trail       
			Spring.SpawnCEG(burnEffect1, x, y + 30, z)      
			Spring.SpawnCEG(burnEffect2, x, y, z)    
		end   
	end ]]--
	end
 end